<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>家训寄语</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #333;
        }

        .container {
            max-width: 750px;
            margin: 0 auto;
            padding: 20px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 头部导航 */
        .header {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h1 {
            font-size: 24px;
            font-weight: bold;
            color: #333;
        }

        .more-link {
            color: #667eea;
            text-decoration: none;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .more-link:hover {
            text-decoration: underline;
        }

        /* 家训寄语卡片容器 */
        .motto-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        /* 家训寄语卡片 */
        .motto-card {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            position: relative;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
        }

        .motto-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
        }

        /* 卡片标签 */
        .motto-label {
            position: absolute;
            top: 12px;
            left: 12px;
            background: rgba(139, 69, 19, 0.8);
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: 500;
            z-index: 2;
        }

        /* 删除按钮 */
        .delete-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            background: rgba(255, 255, 255, 0.8);
            border: none;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 2;
            transition: background 0.3s ease;
        }

        .delete-btn:hover {
            background: rgba(255, 255, 255, 1);
        }

        .delete-btn i {
            font-size: 12px;
            color: #666;
        }

        /* 卡片背景图片 */
        .motto-bg {
            height: 120px;
            background-size: cover;
            background-position: center;
            position: relative;
        }

        .motto-bg::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
        }

        /* 卡片内容 */
        .motto-content {
            padding: 15px;
            background: white;
        }

        .motto-title {
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 8px;
            line-height: 1.4;
        }

        .motto-text {
            font-size: 12px;
            color: #666;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* 左侧卡片 - 食物主题 */
        .motto-card.food-theme .motto-bg {
            background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200"><rect width="300" height="200" fill="%23f5f5dc"/><circle cx="150" cy="100" r="40" fill="%23fff"/><circle cx="120" cy="80" r="15" fill="%2390EE90"/><circle cx="180" cy="90" r="12" fill="%23228B22"/></svg>');
        }

        /* 右侧卡片 - 风景主题 */
        .motto-card.landscape-theme .motto-bg {
            background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23FFD700;stop-opacity:1" /><stop offset="100%" style="stop-color:%23FFA500;stop-opacity:1" /></linearGradient></defs><rect width="300" height="200" fill="url(%23grad1)"/><path d="M0,150 Q75,100 150,120 T300,150 L300,200 L0,200 Z" fill="%234A90E2" opacity="0.3"/><path d="M50,140 Q100,100 150,110 T250,140 L250,200 L50,200 Z" fill="%234A90E2" opacity="0.5"/></svg>');
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .container {
                padding: 15px;
            }
            
            .motto-container {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            
            .header {
                padding: 15px;
            }
            
            .header h1 {
                font-size: 20px;
            }
        }

        /* 底部导航 */
        .bottom-nav {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 15px;
            margin-top: auto;
            display: flex;
            justify-content: space-around;
            box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            padding: 8px;
            border-radius: 12px;
            transition: background 0.3s ease;
        }

        .nav-item:hover {
            background: rgba(102, 126, 234, 0.1);
        }

        .nav-item.active {
            background: rgba(102, 126, 234, 0.15);
            color: #667eea;
        }

        .nav-item i {
            font-size: 18px;
        }

        .nav-item span {
            font-size: 12px;
            font-weight: 500;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部 -->
        <div class="header">
            <h1>家训寄语</h1>
            <a href="#" class="more-link">
                更多 <i class="fas fa-ellipsis-h"></i>
            </a>
        </div>

        <!-- 家训寄语卡片 -->
        <div class="motto-container">
            <!-- 左侧卡片 - 食物主题 -->
            <div class="motto-card food-theme">
                <div class="motto-label">家训寄语</div>
                <button class="delete-btn">
                    <i class="fas fa-trash"></i>
                </button>
                <div class="motto-bg"></div>
                <div class="motto-content">
                    <div class="motto-title">一粥一饭,当思来之不易 ></div>
                    <div class="motto-text">时光荏苒,家风永传。粗瓷碗里盛满着祖辈的智慧，每一粒米都承载着勤俭持家的传统美德...</div>
                </div>
            </div>

            <!-- 右侧卡片 - 风景主题 -->
            <div class="motto-card landscape-theme">
                <div class="motto-label">家训寄语</div>
                <button class="delete-btn">
                    <i class="fas fa-trash"></i>
                </button>
                <div class="motto-bg"></div>
                <div class="motto-content">
                    <div class="motto-title">孝道和美天下 ></div>
                    <div class="motto-text">孝亲敬长传家久,和睦邻里德为本。粒粒皆辛苦，滴滴见真情，传承千年美德...</div>
                </div>
            </div>
        </div>

        <!-- 底部导航 -->
        <div class="bottom-nav">
            <div class="nav-item">
                <i class="fas fa-home"></i>
                <span>首页</span>
            </div>
            <div class="nav-item active">
                <i class="fas fa-quote-left"></i>
                <span>家训</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-history"></i>
                <span>传承</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-heart"></i>
                <span>美德</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-user"></i>
                <span>我的</span>
            </div>
        </div>
    </div>

    <script>
        // 卡片点击效果
        document.querySelectorAll('.motto-card').forEach(card => {
            card.addEventListener('click', function(e) {
                // 如果点击的是删除按钮，不触发卡片点击
                if (e.target.closest('.delete-btn')) {
                    return;
                }
                
                this.style.transform = 'scale(0.98)';
                setTimeout(() => {
                    this.style.transform = '';
                }, 200);
                
                // 这里可以添加跳转到详情页的逻辑
                console.log('点击了家训寄语卡片');
            });
        });

        // 删除按钮点击效果
        document.querySelectorAll('.delete-btn').forEach(btn => {
            btn.addEventListener('click', function(e) {
                e.stopPropagation();
                if (confirm('确定要删除这个家训寄语吗？')) {
                    this.closest('.motto-card').style.opacity = '0';
                    setTimeout(() => {
                        this.closest('.motto-card').remove();
                    }, 300);
                }
            });
        });

        // 底部导航点击效果
        document.querySelectorAll('.nav-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.nav-item').forEach(nav => {
                    nav.classList.remove('active');
                });
                this.classList.add('active');
            });
        });

        // 更多链接点击效果
        document.querySelector('.more-link').addEventListener('click', function(e) {
            e.preventDefault();
            alert('查看更多家训寄语');
        });
    </script>
</body>
</html> 